﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContactUsControl.aspx.cs" Inherits="Portal.Web.Admin.Setting.ContactUsControl" %>

<ul class="lan-ul">
    <li>
        <label>
            载入语言:</label>
        <select id="setting-contactus-culture" name="Culture" editable="false" currentvalue="<%=Model.Culture %>">
        </select>
    </li>
</ul>
<div class="jqeasyui-form">
    <form id="form-setting-contactus" action="ContactUsSave.aspx"
        method="POST">
        <fieldset>
            <legend></legend>
            <p>
                <label>
                    联系我们:</label>
                <span class="span-textarea">
                    <textarea name="ContactUs" id="setting-contactus" style="width: 700px; height: 400px;"><%=Model.ContactUs %></textarea></span>
            </p>
            <p>
                <label>
                </label>
                <input type="button" id="btn-setting-contactus-submit" value="保存" />
            </p>
        </fieldset>
    </form>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var adminSettingCommpanyPostUrl = 'Setting/ContactUsSave.aspx?culture=<%=culture%>';
        $('#setting-about-culture').combobox({
            data: CultureComboboxJsonData,
            valueField: 'id',
            textField: 'text',
            onSelect: function (record) {
                $('#form-setting-about').form('load', 'Setting/SettingJson.aspx?' + 'culture=' + record.id);
                adminSettingCommpanyPostUrl = 'Setting/ContactUsSave.aspx?culture=' + record.id;
            }
        });
        $('#form-setting-contactus').form({
            onBeforeLoad: function () { }, onLoadSuccess: function () {
                self.html($('#setting-contactus').val());
            }
        });
        var contactusSelf;
        KindEditor.create('#setting-contactus', {
            cssPath: '/Content/Common/Widget/kindeditor/plugins/code/prettify.css',
            uploadJson: SettingUploadJson,
            fileManagerJson: SettingFileManagerJson,
            allowFileManager: true, afterCreate: function () {
                contactusSelf = this;

            }
        });
        $('#setting-contactus-culture').combobox("setValue", $('#setting-contactus-culture').attr('currentvalue'));
        $('#btn-setting-contactus-submit').click(function () {
            self.sync();
            $.ajax({
                type: "POST",
                url: adminSettingCommpanyPostUrl,
                data: $("#form-setting-contactus").serialize(),
                dataType: 'json',
                success: function (msg) {
                    if (msg.state) {
                        $.messager.alert('提示', '修改成功！', "info", function () {
                        });
                    }
                },
                error: function () {
                    $.messager.alert('错误', '修改失败！', "error");
                }
            });
        });
    });
</script>
